package com.tuanzi.loan.web.lazy.system.log.error;

import com.tuanzi.loan.log.service.ErrorLogService;
import com.tuanzi.loan.log.service.impl.ErrorLogServiceImpl;
import com.tuanzi.loan.log.vo.request.ErrorLogSearchRequest;
import com.tuanzi.loan.log.vo.response.ErrorLogSearchResponse;
import org.springframework.data.domain.Page;

import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;

/**
 * @author JinRuiyang 2017/11/21
 */
public class ErrorLogLazyDataModel extends
        BaseLazyDataModel<ErrorLogSearchRequest, ErrorLogSearchResponse> {

    private ErrorLogService errorLogService = SpringContextHolder.getBean(ErrorLogServiceImpl.class);

    public ErrorLogLazyDataModel(ErrorLogSearchRequest searchRequest) {
        super(searchRequest);
    }

    @Override
    protected Page<ErrorLogSearchResponse> doLoad(PageSearcher<ErrorLogSearchRequest> pageSearcher) {
        return errorLogService.list(pageSearcher);
    }
}
